global gCurrBtnSprite, gCurrBtnMember, gcurrCastLib, gHilitedBtn, gDontHilite, gSndPath
clearBtnHilite()
if whichCast = VOID then
set currCastLib to "buttons"
else
set currCastLib to whichCast
end if
if whichBtn = VOID then
set gCurrBtnSprite to the clickOn
else
set gCurrBtnSprite to whichBtn
end if
set gCurrBtnMember to the memberNum of sprite gCurrBtnSprite
set whiteBtn to the name of cast gCurrBtnMember of castLib currCastLib
set gHilitedBtn to whiteBtn
put "down" into word the number of words in whiteBtn of whiteBtn
set the memberNum of sprite gCurrBtnSprite to the number of member whiteBtn
set gDontHilite to gCurrBtnSprite
if (whiteBtn contains "quit") or (whiteBtn contains "back") or (whiteBtn contains "help") or (whiteBtn contains "music") or (whiteBtn contains "switch") then
set whichClick to random(14)
puppetSound(2, "fart" & whichClick)
else
set whichClick to random(13)
puppetSound(2, "click" & whichClick)
updateStage()
end if
end
on clearBtnHilite
global gCurrBtnSprite, gCurrBtnMember, gHilitedBtn, gDontHilite
if (gCurrBtnSprite <> EMPTY) and (gCurrBtnMember <> EMPTY) then
put "up" into word the number of words in gHilitedBtn of gHilitedBtn
set the memberNum of sprite gCurrBtnSprite to the number of member gHilitedBtn
updateStage()
set gCurrBtnMember to EMPTY
set gDontHilite to VOID
end if
end
on rllovr whichSprite, whichCast
if whichCast = VOID then
set whichCast to "buttons"
end if
set foo to the memberNum of sprite whichSprite
set grayBtn to the name of member foo of castLib whichCast
put "over" into word the number of words in grayBtn of grayBtn
set the memberNum of sprite whichSprite to the number of member grayBtn
end
on undoRllovr whichSprite, whichCast
if whichCast = VOID then
set whichCast to "buttons"
end if
set foo to the memberNum of sprite whichSprite
set grayBtn to the name of member foo of castLib whichCast
if word 2 of grayBtn <> "off" then
put "up" into word the number of words in grayBtn of grayBtn
end if
set the memberNum of sprite whichSprite to the number of member grayBtn
end
on ghostBuster whichCast
global gCurrBtnSprite, gCurrBtnMember, gMusOn
if whichCast = VOID then
set whichCast to "shared"
end if
set foo to the memberNum of sprite the clickOn
set grayBtn to the name of member foo of castLib whichCast
if word 2 of grayBtn = "off" then
put "up" into word the number of words in grayBtn of grayBtn
set gMusOn to 1
else
put "off" into word the number of words in grayBtn of grayBtn
sound stop 3
set gMusOn to 0
unloadMember(member "peppy")
end if
set the memberNum of sprite the clickOn to the number of member grayBtn
set gCurrBtnSprite to EMPTY
set gCurrBtnMember to EMPTY
end
on flashBtn whichSprite, flashRate, firstState, secondState, whichCast
global gDontHilite
if (gDontHilite <> whichSprite) and ((the ticks mod flashRate) = 0) then
if whichCast = VOID then
set whichCast to "buttons"
end if
set whichBtn to the memberNum of sprite whichSprite
set whiteBtn to the name of member whichBtn of castLib whichCast
if word the number of words in whiteBtn of whiteBtn <> firstState then
put firstState into word the number of words in whiteBtn of whiteBtn
else
put secondState into word the number of words in whiteBtn of whiteBtn
end if
set the memberNum of sprite whichSprite to the number of member whiteBtn
updateStage()
end if
end
on grayOutButtons whereToStart, whereToStop, whichCast
global gCanAcceptKey
if whichCast = VOID then
set whichCast to "buttons"
end if
repeat with X = whereToStart to whereToStop
set Y to the memberNum of sprite X
set grayBtn to the name of member Y of castLib whichCast
set gOriginalButton to grayBtn
put "gray" into word the number of words in grayBtn of grayBtn
set the memberNum of sprite X to the number of member grayBtn
end repeat
updateStage()
end
on BringBackButtons whereToStart, whereToStop, whichCast
global gCanAcceptKey
if whichCast = VOID then
set whichCast to "buttons"
end if
repeat with X = whereToStart to whereToStop
set Y to the memberNum of sprite X
set grayBtn to the name of member Y of castLib whichCast
set gOriginalButton to grayBtn
put "up" into word the number of words in grayBtn of grayBtn
set the memberNum of sprite X to the number of member grayBtn
end repeat
updateStage()
end
on hiliteArrows whichCast, whichBtn
global gCurrBtnSprite, gCurrBtnMember, gcurrCastLib, gHilitedBtn, gDontHilite, gSndPath
if whichCast = VOID then
set currCastLib to "buttons"
else
set currCastLib to whichCast
end if
if whichBtn = VOID then
set currBtnSpt to the clickOn
else
set currBtnSpt to whichBtn
end if
set foo to the name of member the memberNum of sprite currBtnSpt of castLib currCastLib
put "down" into word the number of words in foo of foo
set the memberNum of sprite currBtnSpt to the number of member foo
updateStage()
end
on rllovrTitle whichSprite, whichCastLib
global gLangSelect, gLangDirect, gTitleSpt
set foo to the name of member the memberNum of sprite whichSprite of castLib whichCastLib
set whichLabel to word 1 of foo
if gLangDirect = 1 then
set whichLang to "e"
else
set whichLang to gLangSelect
end if
set the memberNum of sprite gTitleSpt to the number of member (whichLang && whichLabel & " title")
end
on undoRllovrTitle
global gTitleSpt
set the memberNum of sprite gTitleSpt to the number of member "blank title"